//
//  DDAccount.m
//  DingDongXiChe
//
//  Created by wtjr on 2018/1/8.
//  Copyright © 2018年 xieyingze. All rights reserved.
//

#import "DDAccount.h"

@implementation DDAccount

+ (instancetype)AccountStatusWithDictionary:(NSDictionary *)dic {
    DDAccount *account = [DDAccount new];
    account.user_uuid = dic[@"user_uuid"] == nil ? @"" : dic[@"user_uuid"];
    account.user_phone = dic[@"user_phone"] == nil ? @"" : dic[@"user_phone"];
    account.user_name = dic[@"user_name"] == nil ? @"" : dic[@"user_name"];
    
    return account;
}

-  (instancetype)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        self.user_uuid = [decoder decodeObjectForKey:@"user_uuid"];
        self.user_phone = [decoder decodeObjectForKey:@"user_phone"];
        self.user_name = [decoder decodeObjectForKey:@"user_name"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.user_uuid  forKey:@"user_uuid"];
    [aCoder encodeObject:self.user_phone forKey:@"user_phone"];
    [aCoder encodeObject:self.user_name  forKey:@"user_name"];
}

@end
